<?php

namespace App\Http\Controllers\Wechat;

use Laravel\Lumen\Routing\Controller as BaseController;

class Controller extends BaseController
{
    public function serve()
    {
        $wechat = app( 'wechat' );

        $wechat->server->setMessageHandler( function ( $message ) {
            return MessageController::handle( $message );
        } );

        return $wechat->server->serve();
    }
}